package com.cardone.platform.usercenter.service;

import java.util.List;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

import com.cardone.common.cache.Caches;
import com.cardone.common.dto.PaginationDto;
import com.cardone.platform.usercenter.dto.UserActivationDto;

/**
 * 用户激活服务
 *
 * @author yaohaitao
 */
public interface UserActivationService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.usercenter.service.UserActivationService";

	/**
	 * 保存:用户激活
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param saveUserActivation
	 *          用户激活对象
	 *
	 * @return 用户激活对象
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserActivationService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(final Class<P> mappedClass, final UserActivationDto saveUserActivation);

	/**
	 * 插入
	 *
	 * @param insertUserActivation
	 *          用户激活对象
	 *
	 * @return 影响行数
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserActivationService.BEAN_ID, allEntries = true)
	int insertByCode(final UserActivationDto insertUserActivation);

	/**
	 * 删除
	 *
	 * @param deleteUserActivation
	 *          用户激活对象
	 *
	 * @return 影响行数
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserActivationService.BEAN_ID, allEntries = true)
	int deleteByIds(final UserActivationDto deleteUserActivation);

	/**
	 * 更新
	 *
	 * @param updateUserActivation
	 *          用户激活对象
	 *
	 * @return 影响行数
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserActivationService.BEAN_ID, allEntries = true)
	int updateByCode(final UserActivationDto updateUserActivation);

	/**
	 * 查询
	 *
	 * @param readUserActivation
	 *          用户激活对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = UserActivationService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(final UserActivationDto readUserActivation);

	/**
	 * 查询
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param findUserActivation
	 *          用户激活对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = UserActivationService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(final Class<P> mappedClass, final UserActivationDto findUserActivation);

	/**
	 * 查询
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param findUserActivation
	 *          用户激活对象
	 *
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = UserActivationService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(final Class<P> mappedClass, final UserActivationDto findUserActivation);

	/**
	 * 查询
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param findListUserActivation
	 *          用户激活对象
	 *
	 * @return 用户激活对象集合
	 */
	@Deprecated
	@Cacheable(value = UserActivationService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(final Class<P> mappedClass, final UserActivationDto findListUserActivation);

	/**
	 * 分页
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param paginationUserActivation
	 *          用户激活对象
	 *
	 * @return 用户激活分页对象
	 */
	@Deprecated
	@Cacheable(value = UserActivationService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final UserActivationDto paginationUserActivation);
}